<?php

/*

Get New Password (get_new_password.php)

*/

$page_title = "Get New Password";
$rank_check = 0;
include "header.inc.php";

echo $openHTML;

$check = fetch("SELECT username,code FROM lost_passwords2 WHERE username = '$who' AND code = '$code' AND game = '$game'");

if ($check[username])
{
	$new_pass = makepassword();
	$md5_pass = md5($new_pass);
	mysql_query("UPDATE members2 SET password = '$md5_pass' WHERE username = '$who' AND game = '$game'");
	echo "<p>Your new password is: <b>$new_pass</b></p>Click <a href=$base_url/login.php?game=$game>here</a> to login. We suggest changing your password.</p>";
}
if (!$check[username])
{
	echo "<p>Copy the URL directly from your email to get your new password.</p>";
}

echo $closeHTML;

?>